using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Soldier : MonoBehaviour
{
    private PlayerController player => GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
    
    public void InteractAction()
    {
        if (player.canSoldierHide)
        {
            //TODO:相关变化，不能跳跃，速度减慢
            player.speed = Settings.hideSpeed;
            player.canJump = false;
            player.canSoldierHide = false;
            player.isSoldierHide = true;
            player.isLightHide = true;
            player.canMove = false;
            player.rb.velocity = Vector2.zero;
        }
        else
        {
            player.speed = Settings.playerSpeed;
            player.canJump = true;
            player.canSoldierHide = true;
            player.isSoldierHide = false;
            player.isLightHide = false;
            player.canMove = true;
        }
    }
}
